package com.wn.sk.product.core;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author yellow Docter
 * @date 2022 -09-02
 * @desc
 * @ComponentScans(包名)  组件扫描  扫描当前的包和下面的子包的所有的组件
 *      @Mapper,@Controller,@Service组件
 *
 * @MapperScan mapper的扫描
 *
 * @SpringBootApplication 这个注解
 *
 *      @Configuration  配置注解
 *      @ComponentScan      扫描注解(扫描 ProductApplication类下面的 的同级的类和 他下面的子类)
 *      @AutoConfiguration  注解(开启自动配置 )
 *            01  @Import(AutoConfigurationImportSelector.class)
 *            02 AutoConfigurationImportSelector 这个类中加载了 spring.factory这个文件
 *            03 spring.factory 有配置类 xxx配置类
 *            04 加载配置类,进行自动装配
 */
@EnableDiscoveryClient          //服务注册和发现
@MapperScan("com.wn.sk.product.core.mapper")
@SpringBootApplication
@EnableCaching // 开启缓存注解支持
@EnableScheduling   //开启任务调度注解    spring 默认把 任务调度进行了继承
@EnableFeignClients(
        basePackages = "com.wn.sk.order.client" // 扫描指定的client
)
public class ProductApplication {

    public static void main(String[] args) {
        SpringApplication.run(ProductApplication.class,args);
    }

}
